/*
 * demo1.cpp
 *
 *  Created on: 2012-8-20
 *      Author: huangyansheng
 */

#include <gtest/gtest.h>
//计算商品总价
int total_1(int price,int number)
{
	return price*number;
}

TEST(Total_1,price1){
	EXPECT_EQ(10,total_1(1,10));
	EXPECT_EQ(10,total_1(2,5));
	EXPECT_EQ(10,total_1(5,2));
	EXPECT_EQ(10,total_1(10,1));
}
TEST(Total_1,price_zero){
	EXPECT_EQ(0,total_1(0,10));
	EXPECT_EQ(0,total_1(10,0));
}
TEST(Total_1,price_negative){
	EXPECT_EQ(-1,total_1(-1,10));
	EXPECT_EQ(-1,total_1(-10,1));
}

